package com.duobaoyu.dby.supply.biz.service.message;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.duobaoyu.dby.supply.common.biz.dto.message.*;
import com.duobaoyu.dby.supply.core.rocketmq.storage.IMqMessageConsumerStorage;
import com.duobaoyu.dby.supply.core.rocketmq.storage.IMqMessageStorage;
import com.duobaoyu.dby.supply.db.entity.message.ChannelMessage;
import com.duobaoyu.dby.supply.db.entity.message.DelayMessage;
import com.duobaoyu.dby.supply.db.entity.message.MqMessage;

import java.util.List;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName MessageService
 * @createTime 15:23:00 2023/10/07
 */
public interface MessageService extends IMqMessageConsumerStorage, IMqMessageStorage {
    Page<MqMessage> mqMessagePage(MqMessageDTO mqMessage);

    List<MqMessage> mqMessageList(int skipCount, int limit,List<String> statusList, List<String> tags);

    boolean retryRocketMqMessage(String mqMessageId, MqMessage mqMessage);

    /**
     *
     * @param channelMessage
     * @return
     */
    Page<ChannelMessage> channelMessagePage(ChannelMessageDTO channelMessage);

    /**
     * 修改渠道消息状态
     * @param channelMessageStatus
     * @return
     */
    Boolean updateChannelMessageStatus(ChannelMessageStatusDTO channelMessageStatus);

    /**
     * 延时消息分页查询
     * @param delayMessage
     * @return
     */
    Page<DelayMessage> delayMessagePage(DelayMessageDTO delayMessage);

    /**
     * 渠道消息执行业务逻辑
     * @param channelMessageId
     * @return
     */
    Boolean channelMessageHandler(String channelMessageId);

    /**
     * 修改延时消息状态
     * @param delayMessageStatus
     * @return
     */
    Boolean updateDelayMessageStatus(DelayMessageStatusDTO delayMessageStatus);

    /**
     * 延时消息手动执行业务逻辑
     * @param delayMessageId
     * @return
     */
    Boolean delayMessageHandler(String delayMessageId);
}
